﻿using Idte.Application.Core.Actor;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;

namespace Idte.Application.Core.Actor
{
    //public class UserDbInitializer : CreateDatabaseIfNotExists<AppIdentityDbContext>
    //{
    //    protected override void Seed(AppIdentityDbContext context)
    //    {
    //        //UserManager<ApplicationUser> manager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext()));
    //        //manager.Create(new ApplicationUser() { UserName = "tvubinh", FirstName = "Trần", LastName = "Vũ Bình" }, "123456");
            
            
    //        context.Roles.Add(new IdentityRole() { Name = "User" });
    //        IdentityRole role = new IdentityRole() { Name = "Administrator" };
    //        context.Roles.Add(role);
    //        ApplicationUser user = new ApplicationUser() { UserName = "tvubinh", LastName = "Trần", FirstName = "Vũ Bình", PasswordHash = "AOi/zK6tuyCipyZzy+K9jyRl5ZTKQ4hLU88E+G3YbUCR84IVnuR90VmsV2/A36wm1g==", SecurityStamp = "db35ef60-4b49-44ec-b53c-d7bc63145fa2" };
    //        ApplicationUser userAdmin = new ApplicationUser() { UserName = "admin", LastName = "Program", FirstName = "Administrator", PasswordHash = "AGTYzPCGKzsvYdEpTJ3apNt79gKT+KQ9Pt908zJJPM98Lk/DkNOXbJ+ZZVRDLeFmbw==", SecurityStamp = "3f3c687a-71e8-43ca-8b8f-e7fc2a7bcb38" };
    //        IdentityUserRole userRole = new IdentityUserRole() { Role = role, User = userAdmin };
    //        userAdmin.Roles.Add(userRole);
    //        context.Users.Add(user);
    //        context.Users.Add(userAdmin);
    //        context.SaveChanges();
    //    }
    //}
}
